package com.pc.scrs.controller;

import com.pc.scrs.bean.vo.SubjectVo;
import com.pc.scrs.service.ISubjectService;
import com.pc.scrs.utils.ResponseResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/subject")
public class SubjectController {

    @Resource
    private ISubjectService subjectService;

    @GetMapping("/subjectList")
    public ResponseResult querySubjectList(){
        List<SubjectVo> subjectList = subjectService.subjectList();
        if(subjectList!=null){
            return new ResponseResult(200,"ok",subjectList);
        }else {
            return ResponseResult.FAIL;
        }
    }
}
